/*
 * MIT License
 *
 * Copyright (c) 2025 Mark·虎
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

package com.hsxxherp.key.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Date;

/**
 * 模型： 登录日志
 *
 * @author Mark·虎克（2486970363@qq.com）
 */
@TableName("key_login_log")
@Schema(name = "KeyLoginLog", description = "账户登录日志实体类，记录账户的登录相关信息")
public class KeyLoginLogEntity {
    @TableId(type = IdType.AUTO)
    @Schema(description = "登录日志的唯一主键，自增编号", example = "1")
    private Long pkLog;

    @Schema(description = "关联的账户主键，指向账户表中的对应记录", example = "1001")
    private Long pkAccount;

    @Schema(description = "账户登录的时间，精确到日期和时间", example = "2024-01-01 12:00:00")
    private Date loginTime;

    @Schema(description = "账户登录时的 IP 地址，支持 IPv4 和 IPv6 格式", example = "192.168.1.1")
    private String loginIp;

    @Schema(description = "登录状态，0 表示失败，1 表示成功", example = "1")
    private Integer loginStatus;

    @Schema(description = "登录失败时的原因描述，若登录成功则为空", example = "密码错误")
    private String failureReason;

    public Long getPkLog() {
        return pkLog;
    }

    public void setPkLog(Long pkLog) {
        this.pkLog = pkLog;
    }

    public Long getPkAccount() {
        return pkAccount;
    }

    public void setPkAccount(Long pkAccount) {
        this.pkAccount = pkAccount;
    }

    public Date getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }

    public String getLoginIp() {
        return loginIp;
    }

    public void setLoginIp(String loginIp) {
        this.loginIp = loginIp;
    }

    public Integer getLoginStatus() {
        return loginStatus;
    }

    public void setLoginStatus(Integer loginStatus) {
        this.loginStatus = loginStatus;
    }

    public String getFailureReason() {
        return failureReason;
    }

    public void setFailureReason(String failureReason) {
        this.failureReason = failureReason;
    }
}